import { Controller, Get, Query, Request, Post, Body } from '@nestjs/common';
import {UserService} from'./user.service'

@Controller('user')
export class UserController {

    constructor(private userService:UserService){}

    @Get()
    getUser () {
        return this.userService.findAll();
    }

    @Get('add')
    addUser (@Query() query) {
        console.log(query);
        
        return this.userService.create();
    }

    @Get('edit')
    editUser (@Request() req) {
        console.log(req);
        
        return '添加用户'
    }

    @Post('create')
    create (@Body() body) {
        console.log(body);
        
        return '我是post方法'
    }
}
